﻿#pragma once 

#include <QDialog>
#define SIMULATE_HAS_IMPLEMENTED
#ifdef __LINUX__
#undef SIMULATE_HAS_IMPLEMENTED
#include "../include/user_define/CLSimulation.h"
__inline int EagleData_CameralinkStartRead(int devID, eagle_cmlink_export_info* info)
{
	return 0;
}

__inline int EagleData_CameralinkStopRead(int devID)
{
	return 0;
}

__inline int EagleData_CameralinkGetExportStatus(int devID, eagle_cmlink_export_status* info)
{
	return 0;
}

__inline int EagleData_CameralinkSetClock(int devID, char hz)
{
	return 0;
}

#endif

namespace Ui
{
	class pwdDlg;
	class reNamDlg;
	class dlgBitSet;
	class checkSet;
	class snapShotDlg;
	class hexView;
	class softInfoDlg;
	class extraParamsDlg;
	class evfsCfgDlg;
	class crossWireDlg;
}


// 密码验证
class pwdDlg
	:public QDialog
{

public:

	pwdDlg(QWidget* parent);
	virtual void accept();

protected:

private:
	Ui::pwdDlg* ui;
};

// 重命名
class renameDlg
	:public QDialog
{

public:

	renameDlg(QWidget* parent);

	virtual void accept();
	
	QString getNewName();

protected:


private:
	Ui::reNamDlg* ui;
};


// 位宽设置 [12/6/2016 ejitec]
class bitSetDlg
	:public QDialog
{
public:

	bitSetDlg(QWidget* parent, bool &decoder_changed, int nColorDepth, QString& strDecord, QString& strFormat,bool bDecordSel = true);
		
	virtual void accept();

	void showBitWidthOnly();

	void showFormatOnly();

protected:


private:
	Ui::dlgBitSet* ui;
	bool& m_bChange;
	QString& m_strFormatNam;
	QString& m_strDecordNam;
	int m_nColorDepth;
	int m_hHeight;
	bool m_DecodeSel;
};

//////////////////////////////////////////////////////////////////////////
// 自检设置 [12/1/2016 ejitec]

class checkRecordDlg
	:public QDialog
{

public:

	checkRecordDlg(QWidget* parent);

	int getSelCheckType();

	virtual void accept();

protected:

private:
	Ui::checkSet* ui;
};



class RIOManager;
class QImage;

//  抓图 [12/8/2016 ejitec]
class snapDlg
	:public QDialog
{

public:

	snapDlg(QWidget* parent, QString &decoder_name, QPoint& start, QPoint& end, int w, int h, int nDepth, uchar* buf);

	~snapDlg();

	virtual void accept();

protected:

private:
	Ui::snapShotDlg* ui;
	RIOManager* _RIO;

	QString save_dir;
	QImage* _Image;
	unsigned char *source;
	unsigned char *img_buf;
	int decoded_column;
	int decoded_line;
	int decoded_color_depth;
};


//  HexView [12/8/2016 ejitec]

class tableMode;
class hexViewDlg
	:public QDialog
{

public:
	hexViewDlg(QWidget* parent, QPoint& start, QPoint& end, int w, int h, int nDepth, uchar* buf);

	~hexViewDlg();

private:

	Ui::hexView* ui;
	RIOManager* _RIO;
	tableMode* _tableMode;
};


// softInfoDlg [2/13/2017 ejitec]

class systemInfoDlg
	:public QDialog
{
public:
	systemInfoDlg(QWidget* parent,std::vector<int>& device_list);

	/*_inline*/ const QString GetCompileDateTime()
	{
		const int  MONTH_PER_YEAR = 12;
		const char szEnglishMonth[MONTH_PER_YEAR][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
			"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
		char szTmpDate[40] = { 0 };
		char szTmpTime[20] = { 0 };
		char szMonth[4] = { 0 };
		char szYear[5] = { 0 };
		int iMonth, iDay, iHour, iMin, iSec;//

		//获取编译日期、时间
		sprintf(szTmpDate, "%s", __DATE__); //"Sep 18 2010"
		sprintf(szTmpTime, "%s", __TIME__);    //"10:59:19"

		sscanf(szTmpDate, "%s %d %s", szMonth, &iDay, szYear);
		sscanf(szTmpTime, "%d:%d:%d", &iHour, &iMin, &iSec);

		for (int i = 0; MONTH_PER_YEAR; i++)
		{
			//if (_strnicmp(szMonth, szEnglishMonth[i], 3) == 0)
			if (strcmp(szMonth, szEnglishMonth[i]) == 0)
			{
				iMonth = i + 1;
				break;
			}
		}

		QString str = QString("").sprintf("%s%02d%02d %02d:%02d:%02d",
			szYear, iMonth, iDay, iHour, iMin, iSec);

		return str;
	}
private:
	Ui::softInfoDlg* ui;
};


//////////////////////////////////////////////////////////////////////////
// 西光所需要设置帧 偏移 [6/1/2017 xystar]
class QDisPlayWidget;
class extraParamsDlg
	:public QDialog
{
public:

	extraParamsDlg(QWidget* parent);
	virtual void accept();

protected:

private:
	Ui::extraParamsDlg* ui;
	QDisPlayWidget* _caller;
};

class crossWireSetDlg
	:public QDialog
{
public:

	crossWireSetDlg(QWidget* parent);
	virtual void accept();

public slots:

	void on_Apply();

private:
	Ui::crossWireDlg* ui;
};

#ifdef SIMULATE_HAS_IMPLEMENTED
// 仿真器 [11/23/2017 xystar]
class QTimer;
class CEvfsCfgDlg
	:public QDialog
{
public:

	CEvfsCfgDlg(int devID,QWidget* parent);
	virtual void accept();

	void setBindVolumeLetter(wchar_t ch)
	{
		bindVolumeLetter = ch;
	}

	wchar_t GetFirstUnusedVolumeLetter();

	void setInfo(QString);

protected:

	QString GetLogFormatString(int ret, int type);

public slots:
	void on_timeOut();
	void on_startWrite();
	void on_cancelWrite();

private:
	Ui::evfsCfgDlg* ui;
	int _device_id;
	wchar_t		bindVolumeLetter;
	QTimer* export_status_timer;
};
#endif